import { createApp } from 'vue'
import App from './App.vue'
import './assets/global.scss'
import {webLoading} from "@/router/permission"

// unplugin-vue-components插件无法处理非组件模块，因此我们需要手动导入这些样式。less导这个文件，css导入css.js
import "element-plus/es/components/message-box/style/index"   
import "element-plus/es/components/notification/style/index"   
import "element-plus/es/components/message/style/index"  
import "element-plus/es/components/loading/style/index"  


webLoading.loading(document.body)

const app = createApp(App)

import pinia from "@/store/install"
app.use(pinia)

import router from './router'
app.use(router)

import filters from "@/common/filters"
app.use(filters)

// 按需引入el-icon
import { User,Lock,CopyDocument,DocumentAdd,Key,Fold,Expand,ArrowDown,Plus,Iphone,Close,Link,Search,Delete,EditPen} from '@element-plus/icons-vue'
const elIcons=[User,Lock,CopyDocument,DocumentAdd,Key,Fold,Expand,ArrowDown,Plus,Iphone,Close,Link,Search,Delete,EditPen]
elIcons.forEach(v=>{app.component(v.name,v)})

import globalProperties from './common/addGlobalProperty'
app.use(globalProperties)

import "@/common/addWindowProperty"

import i18n from "@/locales"
app.use(i18n)
// console.log(app)

import vuePrint from "vue3-print-nb"
app.use(vuePrint)


import "@/assets/scripts/wxQrcode"


if(import.meta.env.VITE_NODE_ENV != 'dev')
app.config.errorHandler=(err,errvc,errinfo)=>{
   console.log(err,errvc,errinfo)
}

app.mount('#app')



